Repository navigation
RANGER-5718: Add gson to PDP server lib classpath - #1122
Merged
Merged
Conversation
Package gson in the ranger-pdp tarball and declare it as a PDP dependency so AbstractRangerAdminClient can initialize GsonBuilder without NoClassDefFoundError on plugin startup. https: //issues.apache.org/jira/browse/RANGER-5718 Co-authored-by: Cursor <cursoragent@cursor.com>
mneethiraj
approved these changes
Aug 1, 2026
ramackri
pushed a commit
that referenced
this pull request
Aug 1, 2026
Package gson in the ranger-pdp tarball and declare it as a PDP dependency so AbstractRangerAdminClient can initialize GsonBuilder without NoClassDefFoundError on plugin startup. Backport of e8afc18 (#1122) from master. https://issues.apache.org/jira/browse/RANGER-5718
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
NoClassDefFoundError: com/google/gson/GsonBuilderlogged by the Ranger PDP server on every plugin initialization when policies/tags are downloaded from Admin.The PDP assembly descriptor (
distro/src/main/assembly/pdp.xml) uses a strictlib/dependency whitelist but did not includegson, unlike other Ranger plugin assemblies (KMS, Kafka, Solr, etc.). As a result,ranger-2.9.0-pdp.tar.gzand theranger-pdpdocker image ship withoutgson-*.jaron the classpath.Policy download and authorization still work today because
RangerAdminRESTClientparses Admin REST responses with Jackson. The error is non-fatal (AbstractRangerAdminClient.init()catches it and leavesgsonnull) but is noisy and leaves file-based policy sources (EmbeddedResourcePolicySource,LocalFolderPolicySource) without Gson support.Changes
distro/src/main/assembly/pdp.xml: addcom.google.code.gson:gson:jar:${gson.version}to the binaries whitelistpdp/pom.xml: declare explicitgsonruntime dependencyTest plan
mvn install -pl pdp,... -am)gson-2.9.0rangernwstack (isolated PDP on port 16500):gson-2.9.0.jarinlib/: health READY,POST /authz/v1/authorize→ ALLOW,PolicyRefresherdownloads policies, no GsonBuilder ERRORNoClassDefFoundErrorreproducedranger-*-pdp.tar.gzand verifytar -tzf ... | grep gsonJira
https://issues.apache.org/jira/browse/RANGER-5718
Made with Cursor